import java.util.Arrays;
import java.util.Scanner;

public class Array_FindNum {

    public static void FindNum(int number,int[] array) {
        Arrays.sort(array);
        int l=0,r=array.length-1;
        while(l<=r) {
            int mid=(l+r)/2;
            if(number<array[mid]) {
                r=mid-1;
            }else if(number>array[mid]) {
                l=mid+1;
            }else {
                System.out.println("找到了！");
                return;
            }
        }
        System.out.println("没找到");
    }


    public static void main(String[] args) {
        int[] arr=new int[]{23,67,90,24,8,53,20};
        System.out.println("请输入你要查找的元素：");
        Scanner scanner =new Scanner(System.in);
        int num=scanner.nextInt();
        FindNum(num,arr);
    }
}
